Using dynamic text within comment fields

Neuron Power Engineer evaluates a dynamic text depending on the element to which the →comment field has been attached. Hence, let Neuron Power Engineer evaluate certain information.

The following dynamic texts are supported:

Dynamic text

Meaning

{comment}

if the comment field is attached to a value field containing a variable: comment of the variable

{dataType}

→data type of the →variable or the →function block type

{instanceData("element", "parameter/text")}

instance data for →function block instance
(info) Instance data elements are additional data elements for the function block. Usually, such instance data elements exist only for function blocks within a library provided by a system integrator. If you want to enter/define such instance data elements for a block within the graphical user interface of Neuron Power Engineer, you require a Neuron Power Engineer variant that has been enhanced by a system integrator.

The following data is required within the dynamic text:

  • element: name of one instance data element; example: ActiveGroup

  • parameter/text: one or several of the following parameters – with or without plain text (see the following examples)

Parameter

Meaning

%n or %name

name of the instance data element; example: ActiveGroup

%t or %type

type of the instance data element; example: STRING

%v or %value

value of the instance data element; example: Passive

If you skip parameter/text, the dynamic text is evaluated as %v by default. If you want to quote text within parameter/text, use the single quote character '. The double quote character " is not supported within parameter/text.

Observe:

  • If the information is not available for an element, no corresponding text is displayed within the comment field.

  • The characters { and } are reserved for dynamic texts. If you want to display these characters within a comment field, prefix them with the character \.

    Example for input

    COLOR = \{blue, yellow, red\}

Examples of evaluating instance data

It is possible to enter a plain text outside and/or inside the dynamic text for the instance data. Use the method best suited for you.

Input within the comment field

Example of evaluation

Plain text outside the dynamic text

Group: {instanceData ("ActiveGroup")}
Group: MX2040

 

Plain text inside the dynamic text
{instanceData ("ActiveGroup", "Group '%n' with value '%v'")}

or

Plain text outside the dynamic text
Group '{instanceData ("ActiveGroup", "%n")}' with value '{instanceData ("ActiveGroup", "%v")}'
Group 'MX2040' with value 'Passive'

 

Plain text inside the dynamic text

{instanceData("simplefield", "Instance data:
 
Name:  '%n',
Value: '%v',
Type:  '%t'")}

or

Plain text outside the dynamic text
Instance data:
 
Name:  '{instanceData("simplefield", "%n")}',
Value: '{instanceData("simplefield", "%v")}',
Type:  '{instanceData("simplefield", "%t")}'
Instance data:
 
Name:  'simplefield',
Value: '1234',
Type:  'INT'